<div class="index">
	<h2><?php __('Danh sách Đơn vị');?></h2>
	<table cellpadding="0" cellspacing="0" id="tables">
	<tr>
			<th><?php echo 'STT';?></th>
			<th><?php echo 'Mã Đơn Vị';?></th>
			<th><?php echo 'Tên Đơn Vị';?></th>
			<th class="actions"><?php __('Lựa chọn');?></th>
	</tr>
	<?php
	$i = 0;$stt=0;
	foreach ($donvis as $donvi):
		$class = null;
		if ($i++ % 2 == 0) {
			$class = ' class="altrow"';}
		if ( substr($donvi['Donvi']['madv'],0,2)=='TT'){
	?>
	<tr<?php echo $class;?>>
		<td><?php echo $stt=$stt+1; ?>&nbsp;</td>
		<td><?php echo $donvi['Donvi']['madv']; ?>&nbsp;</td>
		<td><?php echo $donvi['Donvi']['tendv']; ?>&nbsp;</td>
		<td class="actions">
			<?php echo $this->Html->link(__('Kênh Bán Hàng', true),  array('controller'=>'nhanviens','action'=>'phankenh',$donvi['Donvi']['id']));?>
			<?php echo $this->Html->link(__('Kênh Chưa Giao', true),  array('controller'=>'kenhs','action'=>'kenhrong',$donvi['Donvi']['id']));?>
		</td>
	</tr>
<?php } endforeach;?>
	</table>
	<p>
	<?php
	echo $this->Paginator->counter(array(
	'format' => __('Page %page% of %pages%, showing %current% records out of %count% total, starting on record %start%, ending on %end%', true)
	));
	?>	</p>

	<div class="paging">
		<?php echo $this->Paginator->prev('<< ' . __('previous', true), array(), null, array('class'=>'disabled'));?>
	 | 	<?php echo $this->Paginator->numbers();?>
 |
		<?php echo $this->Paginator->next(__('next', true) . ' >>', array(), null, array('class' => 'disabled'));?>
	</div>
</div>
